package  #(customConfig.saveOrUpdateDTOPackage);

#for(importClass : table.buildImports(customConfig.isBase))
import #(importClass);
#end
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * #(table.getComment()) 接收保存/更新参数类。
 *
 * @author #(javadocConfig.getAuthor())
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class #(customConfig.saveOrUpdateDTOClassName){

#for(column : table.columns)
    #if((column.property) != "isDeleted")
    #if((column.property) != "createTime")
    #if((column.property) != "updateTime")
    #set(comment = javadocConfig.formatColumnComment(column.comment))
    #if(hasText(comment))
    /**
     * #(comment)
     */
    #end
    #set(annotations = column.buildAnnotations())
    #if(hasText(annotations))
    #(annotations)
    #end
    #if((column.propertySimpleType) == "Integer")
    @IntListValue(values = {0, 1})
    private Integer #(column.property);

    #elseif((column.propertySimpleType) == "Long")
    #if((column.property) == "id")
    @NotNull(groups = {UpdateGroup.class}, message = "更新时必须上传指定id")
    @Null(groups = {AddGroup.class}, message = "新增时请勿指定id")
    #end
    private Long #(column.property);

    #elseif((column.propertySimpleType) == "String")
    @NotBlank(groups = {AddGroup.class})
    private String #(column.property);

    #else
    @NotNull(groups = {AddGroup.class})
    private #(column.propertySimpleType) #(column.property);

    #end
    #end
    #end
    #end
#end
}
